#include <iostream>
#include <vector>
#include <string>

#include "instancereader.h"
#include "Instance.h"
#include "utils.h"
#include "stackrecord.h"
#include "solver.h"

#include <boost/dynamic_bitset.hpp>

using namespace std;
int main()
{

	InstanceReader rdr = InstanceReader(std::cin);
	Instance inst = rdr.readInstance();

	Solver s(inst);
	s.solve();

	return 0;
}